import 'package:flutter/material.dart';

class WButton extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("图片组件"),
        centerTitle: true,
      ),
      body: Container(
        margin: EdgeInsets.only(left: 10),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            RaisedButton(
              child: Text('onPressed设置为null时，按钮事件不可用'),
              onPressed: null,
              disabledColor: Colors.amberAccent,
              //禁用状态下背景颜色
              disabledTextColor: Colors.red, //禁用状态下字体颜色
            ),
            RaisedButton(
              child: Text('按钮可用'),
              textColor: Colors.white,
              //字体颜色
              color: Colors.blue,
              //背景颜色
              onPressed: () {
                print("按钮可用按下事件");
              },
              highlightColor: Colors.deepOrangeAccent, //高亮颜色，按下时的颜色
            ),
            FlatButton(
              onPressed: () {
                print("FlatButton");
              },
              child: Text('Button'),
              color: Colors.red,
              textColor: Colors.white,
            ),
            OutlineButton(
              child: Text('代边框的按钮'),
              onPressed: () {},
            ),
            SizedBox(
              height: 10,
            ),
            Container(
              padding: EdgeInsets.all(10),
              decoration: BoxDecoration(
                  color: Colors.red,
                  border: Border.all(color: Colors.black, width: 2),
                  borderRadius: BorderRadius.all(Radius.circular(30))),
              child: InkWell(
                onTap: () {
                  print("点击了圆角矩形");
                },
                child: Text(
                  "圆角矩形",
                  style: TextStyle(color: Colors.white),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
